/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* 配置对话框 */
.config-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.config-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.config-content h2 {
    margin-bottom: 8px;
    color: #333;
    font-size: 24px;
}

.config-content p {
    margin-bottom: 24px;
    color: #666;
    font-size: 14px;
}

.config-step h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 18px;
}

.config-step p {
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.selected-path {
    margin-top: 12px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.config-navigation {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

/* 按钮样式 */
.btn-primary {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #0056CC;
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

.btn-text {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-text:hover {
    color: #0056CC;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #f8f9fa;
}

/* 主应用界面 */
.app-header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.app-main {
    display: flex;
    height: calc(100vh - 72px);
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.team-members {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.team-members h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #333;
}

.member:hover {
    background-color: #f8f9fa;
}

.member.active {
    background-color: #007AFF;
    color: white;
}

/* 文件浏览器 */
.file-explorer {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    flex: 1;
    overflow-y: auto;
}

.file-explorer h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.file-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-item {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.file-item.directory {
    font-weight: 500;
}

.file-item.file {
    padding-left: 24px;
}

.file-icon {
    font-size: 16px;
}

/* 任务面板 */
.tasks-panel {
    padding: 24px;
    overflow-y: auto;
}

.tasks-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.task-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.task-controls button {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
}

.task-status {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-item .label {
    color: #666;
}

.status-item .value {
    font-weight: 600;
    color: #333;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.2s;
}

.task-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.task-item.pending {
    border-left: 4px solid #ff9800;
}

.task-item.running {
    border-left: 4px solid #2196f3;
}

.task-item.completed {
    border-left: 4px solid #4caf50;
}

.task-item.failed {
    border-left: 4px solid #f44336;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.task-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.task-status.pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

.task-status.running {
    background-color: #e3f2fd;
    color: #1976d2;
}

.task-status.completed {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.task-status.failed {
    background-color: #ffebee;
    color: #c62828;
}

.task-progress {
    margin: 8px 0;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 4px;
    background-color: #4caf50;
    transition: width 0.3s;
}

.task-actions {
    margin-top: 8px;
}

.btn-start-task {
    padding: 4px 8px;
    font-size: 11px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-start-task:hover {
    background-color: #1976d2;
}

.task-output {
    margin-top: 8px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 11px;
}

.task-output summary {
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.output-content {
    margin-top: 8px;
    padding: 8px;
    background-color: white;
    border-radius: 3px;
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.4;
}

.task-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.task-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.task-priority {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.task-priority.high {
    background-color: #ffebee;
    color: #c62828;
}

.task-priority.medium {
    background-color: #fff3e0;
    color: #ef6c00;
}

.task-priority.low {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.task-assignee {
    color: #666;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 输出面板 */
.output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e0e0e0;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.panel-tabs .tab {
    padding: 12px 24px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.panel-tabs .tab:hover {
    color: #333;
    background-color: #e9ecef;
}

.panel-tabs .tab.active {
    color: #007AFF;
    border-bottom-color: #007AFF;
    background-color: white;
}

.panel-content {
    flex: 1;
    position: relative;
}

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Monaco编辑器 */
.monaco-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* 预览面板 */
.preview-content {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.preview-content pre {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* 控制台面板 */
.console-output {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* 甘特图样式 */
.gantt-chart {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    background-color: white;
}

.gantt-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 14px;
}

.gantt-item {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.gantt-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.gantt-item .task-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.gantt-item .task-assignee {
    font-size: 12px;
    color: #666;
    padding: 2px 6px;
    background-color: #e3f2fd;
    border-radius: 3px;
}

.gantt-item-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.gantt-item .progress-bar {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s;
}

.gantt-item.pending .progress-bar {
    background-color: #ff9800;
}

.gantt-item.running .progress-bar {
    background-color: #2196f3;
}

.gantt-item.completed .progress-bar {
    background-color: #4caf50;
}

.gantt-item.failed .progress-bar {
    background-color: #f44336;
}

.console-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}

.console-line {
    margin-bottom: 4px;
}

.console-line.error {
    color: #f44336;
}

.console-line.warning {
    color: #ff9800;
}

.console-line.success {
    color: #4caf50;
}

.chat-area {
    height: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background-color: #007AFF;
    color: white;
}

.message.ai {
    align-self: flex-start;
    background-color: #f8f9fa;
    color: #333;
}

.message.system {
    align-self: center;
    background-color: #e3f2fd;
    color: #1976d2;
    font-size: 12px;
    max-width: 50%;
}

.message.task-creation {
    align-self: flex-start;
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.chat-input {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-actions {
    display: flex;
    gap: 8px;
}

.chat-input textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    min-height: 40px;
    max-height: 120px;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #007AFF;
}

/* 文件上传样式 */
.file-upload {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* 测试结果样式 */
#ai-test-result {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

#ai-test-result.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#ai-test-result.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .config-content {
        width: 95%;
        padding: 24px;
    }
    
    .app-main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 200px;
    }
    
    .member-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .member {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
} 